package com.ry.es.model;

import com.google.common.collect.Lists;

import java.util.List;

/**
 * Created by walker on 17-11-22.
 *
 */
public class EsPage
{
    private long total;
    private int pageNo;
    private int pageSize = 15;
    private List<EsModel> list = Lists.newArrayList();;

    public long getTotal()
    {
        return total;
    }

    public void setTotal(long total)
    {
        this.total = total;
    }

    public int getPageNo()
    {
        if(pageNo <= 0)
            pageNo = 1;
        return pageNo;
    }

    public void setPageNo(int pageNo)
    {
        this.pageNo = pageNo;
    }

    public int getPageSize()
    {
        if(pageSize <= 0)
            pageSize = 15;
        return pageSize;
    }

    public void setPageSize(int pageSize)
    {
        this.pageSize = pageSize;
    }

    public List<EsModel> getList()
    {
        return list;
    }

    public void setList(List<EsModel> list)
    {
        this.list = list;
    }

    public void add(EsModel esModel){
        list.add(esModel);
    }
}
